package com.jenings.shop.service;

import com.jenings.shop.entity.Seller;
import com.jenings.shop.mapper.SellerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SellerService {
    @Autowired
    SellerMapper sellerMapper;
    //查询全部卖家
    public List<Seller> selectAll(){
        List<Seller> sellerList = sellerMapper.selectAll();
        return sellerList;
    }
    //查询部分卖家
    public List<Seller> selectSome(String mjname){
        List<Seller> sellerList = sellerMapper.selectSome(mjname);
        return sellerList;
    }
    //查询固定卖家
    public Seller selectByte(String mjname){
        Seller seller = sellerMapper.selectByte(mjname);
        return seller;
    }
    //卖家修改个人信息
    public boolean updateByte(Seller seller){
        return sellerMapper.updateByte(seller);
    }
    //添加卖家
    public boolean insertByte(Seller seller){
        return sellerMapper.insertByte(seller);
    }
    //删除卖家
    public boolean delByte(Integer mjid){
        return sellerMapper.delByte(mjid);
    }
}
